package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TQuestionOption;
import com.party.business.mapper.TQuestionOptionMapper;
import com.party.business.service.ITQuestionOptionService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 题目选项信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class TQuestionOptionServiceImpl extends ServiceImpl<TQuestionOptionMapper, TQuestionOption>  implements ITQuestionOptionService
{
    @Autowired
    private TQuestionOptionMapper tQuestionOptionMapper;

    /**
     * 查询题目选项信息
     *
     * @param id 题目选项信息主键
     * @return 题目选项信息
     */
    @Override
    public TQuestionOption selectTQuestionOptionById(String id)
    {
        return tQuestionOptionMapper.selectTQuestionOptionById(id);
    }

    /**
     * 查询题目选项信息列表
     *
     * @param tQuestionOption 题目选项信息
     * @return 题目选项信息
     */
    @Override
    public List<TQuestionOption> selectTQuestionOptionList(TQuestionOption tQuestionOption)
    {
        return tQuestionOptionMapper.selectTQuestionOptionList(tQuestionOption);
    }

    /**
     * 新增题目选项信息
     *
     * @param tQuestionOption 题目选项信息
     * @return 结果
     */
    @Override
    public int insertTQuestionOption(TQuestionOption tQuestionOption)
    {
                tQuestionOption.setCreateTime(DateUtils.getNowDate());
            return tQuestionOptionMapper.insertTQuestionOption(tQuestionOption);
    }

    /**
     * 修改题目选项信息
     *
     * @param tQuestionOption 题目选项信息
     * @return 结果
     */
    @Override
    public int updateTQuestionOption(TQuestionOption tQuestionOption)
    {
                tQuestionOption.setUpdateTime(DateUtils.getNowDate());
        return tQuestionOptionMapper.updateTQuestionOption(tQuestionOption);
    }

    /**
     * 批量删除题目选项信息
     *
     * @param ids 需要删除的题目选项信息主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionOptionByIds(String[] ids)
    {
        return tQuestionOptionMapper.deleteTQuestionOptionByIds(ids);
    }

    /**
     * 删除题目选项信息信息
     *
     * @param id 题目选项信息主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionOptionById(String id)
    {
        return tQuestionOptionMapper.deleteTQuestionOptionById(id);
    }
}
